package com.yizhang.sqlSession;

import com.yizhang.executor.SimpleExecutor;
import com.yizhang.pojo.Configuration;

/**
 * @Author: yi.zhang
 * @CreateTime: 2025-05-27 16:41:17
 * @Description:
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        SimpleExecutor executor = new SimpleExecutor();
        return new DefaultSqlSession(configuration, executor);
    }
}
